#ifndef QGOOGLEMAPVIEWER_H
#define QGOOGLEMAPVIEWER_H

#include <QWidget>
#include <QVector>
#include "viewport.h"
#include "googletile.h"
#include <QPoint>

class QGoogleMapViewer : public QWidget
{
	Q_OBJECT
public:
	explicit QGoogleMapViewer(QWidget *parent = 0);

signals:

public slots:
	void TileDownLoaded(GoogleTile* tile);

protected:
	void paintEvent(QPaintEvent* event);
	void showEvent(QShowEvent *);
	void mouseMoveEvent(QMouseEvent* event);
	void mousePressEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent* event);
    void wheelEvent(QWheelEvent* event);
    void updateView();

private:
	QVector<GoogleTile*> tileList;
	ViewPort viewPort;
	QPoint preClickPt;
	bool bLButtonDown;
};

#endif // QGOOGLEMAPVIEWER_H
